home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / pack.z / pack
Encoding:
Text File  |  2002-10-03  |  3.1 KB  |  75 lines

  1. PACK(3I)                                              Last changed: 4-13-99
  2.  
  3.  
  4. NNAAMMEE
  5.      PPAACCKK - Packs an array into an array of rank one under control of a
  6.      mask
  7.  
  8. SSYYNNOOPPSSIISS
  9.      PPAACCKK (([AARRRRAAYY==]_a_r_r_a_y,, [MMAASSKK==]_m_a_s_k [,,[VVEECCTTOORR==]_v_e_c_t_o_r]))
  10.  
  11. IIMMPPLLEEMMEENNTTAATTIIOONN
  12.      UNICOS, UNICOS/mk, IRIX systems
  13.  
  14.      CF90, MIPSpro 7 Fortran 90
  15.  
  16. SSTTAANNDDAARRDDSS
  17.      Fortran
  18.  
  19. DDEESSCCRRIIPPTTIIOONN
  20.      The PPAACCKK intrinsic function packs an array into an array of rank one
  21.      under control of a mask.  It can be used for array construction.  It
  22.      accepts the following arguments:
  23.  
  24.      _a_r_r_a_y     Can be of any type.  It must not be scalar.
  25.  
  26.      _m_a_s_k      Must be of type logical and must be conformable with _a_r_r_a_y.
  27.  
  28.      _v_e_c_t_o_r    Must be of the same type as _a_r_r_a_y and must have rank one.
  29.                _v_e_c_t_o_r must have at least as many elements as there are true
  30.                elements in _m_a_s_k.  If _m_a_s_k is scalar with the value true,
  31.                _v_e_c_t_o_r must have at least as many elements as there are in
  32.                _a_r_r_a_y.
  33.  
  34.      PPAACCKK is a transformational function.  The name of this intrinsic
  35.      cannot be passed as an argument.
  36.  
  37. RREETTUURRNN VVAALLUUEESS
  38.      The result is an array of rank one of the same type as _a_r_r_a_y.  If
  39.      _v_e_c_t_o_r is present, the result size is that of _v_e_c_t_o_r; otherwise, the
  40.      result size is the number _t of true elements in _m_a_s_k unless _m_a_s_k is
  41.      scalar with the value true in which case the result size is the size
  42.      of _a_r_r_a_y.
  43.  
  44.      Element _i of the result is the element of _a_r_r_a_y that corresponds to
  45.      the _ith true element of _m_a_s_k, taking elements in array element order,
  46.      for _i=1, 2, ..., _t.  If _v_e_c_t_o_r is present and has size _n>_t, element _i
  47.      of the result has the value _v_e_c_t_o_r(_i), for _i=_t+1, ..., _n.
  48.  
  49. EEXXAAMMPPLLEESS
  50.      Example 1:  If NN == ((// 11,, --11,, 33 //)), the following are true:
  51.  
  52.           PPAACCKK(( NN,, MMAASSKK==NN..LLTT..00)) is ((//--11//)).
  53.  
  54.           PPAACCKK(( NN,, MMAASSKK==..TTRRUUEE..)) is ((//11,,--11,,33//)).
  55.  
  56.      Example 2:  Array MM is as follows:
  57.  
  58.      | 0 0 0 |
  59.  
  60.      | 9 0 0 |
  61.  
  62.      | 0 0 7 |
  63.  
  64.      The nonzero elements of array MM can be gathered by the PPAACCKK function.
  65.      The following are the results:
  66.  
  67.           PPAACCKK((MM,, MMAASSKK==MM..NNEE..00)) is ((//99,,77//)).
  68.  
  69.           PPAACCKK((MM,, MMAASSKK==MM..NNEE..00,, VVEECCTTOORR==((//22,, 44,, 66,, 88,, 1100,, 1122//)))) is ((//99,, 77,, 66,,
  70.           88,, 1100 1122//)).
  71.  
  72. SSEEEE AALLSSOO
  73.      _I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed version of this
  74.      man page.
  75.